import java.util.Scanner;

public class Test07 {
    static void main() {
        Scanner sc = new Scanner(System.in);
        boolean isGo = true;
        double sum = (double)0.0F;
        int count = 0;
        while(isGo) {
            System.out.println("请输入第" + (count + 1) + "个学生成绩:");
            double score = sc.nextDouble();
            ++count;
            sum += score;
            System.out.println("请问您是否继续输入？（Y/N）");
            String s = sc.next();
            if (!s.equals("Y")) {
                isGo = false;
            }
        }
        System.out.println(sum);
        System.out.println(count);
        System.out.println("平均分为" + sum / (double)count);
        System.out.println("程序停止");
    }
}
